package com.i8office.android.zhihuixinwu.module.presenter;

import com.cyan.tools.callback.SimpleCallback;
import com.i8office.android.zhihuixinwu.module.contract.CalendarContract;
import com.i8office.android.zhihuixinwu.module.model.CalendarModel;
import com.i8office.android.zhihuixinwu.ui.schedule.LeaderData;

public class ChooseLeaderPresenter extends BasePresenterImpl<CalendarContract.ChooseLeaderView> implements CalendarContract.ChooseLeaderPresenter {
    private CalendarContract.Model model;

    public ChooseLeaderPresenter(CalendarContract.ChooseLeaderView view) {
        super(view);
        model = new CalendarModel();

    }

    @Override
    public void getLeadersData() {
        addDisposable(model.getLeadersData(new SimpleCallback<LeaderData>(mView) {
            @Override
            public void requestError(String msg) {
                super.requestError(msg);
                mView.toast(msg);
            }

            @Override
            public void requestSuccess(LeaderData data) {
                mView.showLeadersData(data.relations);
            }
        }));
    }
}
